<?php

/**
 * RepairMsgtpl报修消息模版推送
 *
 * @author hjc19850430@gmail.com
 */
class RepairMsgtpl extends BaseMsgtpl
{
	/**
	 * 自动派单发送消息
	 * @param array $wechat		公众号信息
	 * @param array $order		订单信息
	 * @param array $repairman	维修工
	 * @return
	 */
	public function autoOperateSendMsg($wechat, $order ,$repairman,$accountId)
	{
		$wechatUserInfo = D('Wechat/WechatUser')->getInfo(array('user_id' => $repairman), 'openid,subscribe');
		$url = C('site_url').'/index.php?g=base&m=repair&a=orderDetail&repairId='.$order['repair_id'].'&order_id='.$order['order_id'];
		if($this->wechatInfo['account_id'] == 2){
			$template_id = 'D3IHmxcLckGTHiXw-LDlApX9VIWdOvcZgVqyunmESjo';
		}elseif($this->wechatInfo['account_id'] == 5){
			$template_id = '4EeswD5oYCEQJi2u8AOzAQrflX5aCQVxFOcr592-fvY';
		}elseif($this->wechatInfo['account_id'] == 6){
			$template_id = 'y2OZQJsNL3wXLOrbTuXzuX2x5IVT_ZDsLodN3Mpzyug';
		}elseif($this->wechatInfo['account_id'] == 4){  //测试服
			$template_id = 'k203JXlZ8F8SCYUIR3uH_HBL8Uq2aAMbAIv2N1r46ec';
		}elseif($this->wechatInfo['account_id'] == 10){  //铁道部
			$template_id = 'RUdkrbYCT4fM8eYiEzMGoFrdj7tM2g9YI_Px4xaxETU';
		}elseif($this->wechatInfo['account_id'] == 28){//树人大学
//			$template_id = '_hHj0eU1ZQ7yorFomzpQvFV21NxQj8S_bqolOO9sbBk';
            $template_id = 'aUAE44YKKix1JXuZ_bljhI7dZPlgMjrS_uAr_8Ec4zs';
		}elseif($this->wechatInfo['account_id'] == 3){
			$template_id = 'Xip28HCL4EbvNB6bItDLrIheQnOceLI87-ZDE5f4m0A';
		}elseif($this->wechatInfo['account_id'] == 17){
			$template_id = 'nr3BnPPtM-TA11B537yEf9_CRIV9KXbL9wn7lDJxWFg';
		}elseif($this->wechatInfo['account_id'] == 11){
			$template_id = '0NSi0BNiF-5mrwd9MODtQ86jzp9G93DNnThFSTuXAiQ';
		}elseif($this->wechatInfo['account_id'] == 25){
			$template_id = 'ZDCiG5Bx4D-WUkYT4vDpiLx-MoMR-uI0hZi-20lkrhs';
		}elseif($this->wechatInfo['account_id'] == 60){// 测试服云感维修模板id
            $template_id = 'Rf7JatKFZNlX-Fji4e2AmRwCvffF8bCsUxdnsHCHAZs';
            //$template_id = '-o2OC55fvrdUsNuXd0wFsM2hO3Rn8ey277dCpJTg3JI';
        }elseif ($this->wechatInfo['account_id'] == 65) {//紫元物业
            $template_id = 'xuLPonzO3SE36UfXU3kJI4HAXQ0Q80cHWR1Unv5xCHg';
        }


		if($this->wechatInfo['account_id'] == 4){
			$info = array(
				'first' => array("value" => '您有新的派单，请在您的维修广场查看！','color' => '#173177'),
				'keyword1' => array("value" => '订单号' ),
				'keyword2' => array("value" => date("Y-m-d H:i:s")),
				'keyword3' => array("value" => '123456' ),
				'remark' => array("value" => "您有新的派单，请点击查看！","color" => "#173177"),
			);
		}elseif($this->wechatInfo['account_id'] == 11){
			$info = array(
				'first' => array("value" => '您有新的派单，请在您的维修广场查看！','color' => '#173177'),
				'keyword1' => array("value" => $order['order_sn'] ),
				'keyword2' => array("value" => $order['status'] == 2?'派单成功':'系统派单'),
				'keyword3' => array("value" => date("Y-m-d H:i:s")),
				'remark' => array("value" => "您有新的派单，请点击查看！","color" => "#173177"),
			);
		}elseif($this->wechatInfo['account_id'] == 28 || $this->wechatInfo['account_id'] == 25){
            $info = array(
                'first' => array("value" => '您有新的派单，请在您的维修广场查看！','color' => '#173177'),
                'keyword1' => array("value" => $order['real_name'] ),
                'keyword2' => array("value" => date("Y-m-d H:i:s")),
                'keyword3' => array("value" => $order['community_name'] . $order['building_name'] . $order['room_name'] . $order['detail_address']),
                'keyword4' => array("value" => $order['content']),
                'remark' => array("value" => "您有新的派单，请点击查看！","color" => "#173177"),
            );
        } elseif ($this->wechatInfo['account_id'] == 65){
            $projectName = '';
            if ($order['project_id']) {
                $projectInfo = D('Base/RepairProject')->getByProjectId($order['project_id']);
                $projectName = $projectInfo['project_name'];
            }
            $childProject = '';
            if ($order['project_child_id']) {
                $childInfo = D('Base/RepairProject')->getByProjectId($order['project_child_id']);
                $childProject = ' ' . $childInfo['project_name'];
            }

            $projects = $projectName ? $projectName . ($childProject ? $childProject : '') : '-';
            $info = array(
                'first' => array("value" => '您有新的派单，请在您的维修广场查看！', 'color' => '#173177'),
                'keyword1' => array("value" => $order['real_name']),
                'keyword2' => array("value" => $order['content']),
                'keyword3' => array("value" => $projects),
                'keyword4' => array("value" => $order['community_name'] . $order['building_name'] . $order['room_name'] . $order['detail_address']),
                'keyword5' => array("value" => date("Y-m-d H:i:s"), "color" => "#173177"),
                'remark' => array("value" => "点击查看详情！", "color" => "#173177"),
            );

        }else{
			$info = array(
				'first' => array("value" => '您有新的派单，请在您的维修广场查看！','color' => '#173177'),
				'keyword1' => array("value" => $order['real_name'] ),
				'keyword2' => array("value" => date("Y-m-d H:i:s"),"color" => "#173177"),
				'keyword3' => array("value" => date('Y-m-d H:i:s',strtotime("+1 hour")),"color" => "#173177" ),
				'remark' => array("value" => "您有新的派单，请点击查看！","color" => "#173177"),
			);
		}
		$result = $this->wxObj->messageTpl($this->wechatInfo['appid'], $this->wechatInfo['appsecret'], $wechatUserInfo['openid'], $template_id, $info, $url);
		return $result;
	}
    /**
     * 报修人取消订单给所在订单维修工发送消息
     * @param array $wechat		公众号信息
     * @param array $order		订单信息
     * @param array $repairman	维修工
     * @return
     */
    public function abolishRepairmanSendMsg($order,$accountId)
    {
        $wechatUserInfo = D('Wechat/WechatUser')->getInfo(array('user_id' => $order['repairman_id']), 'openid,subscribe');
        $url = C('site_url').'/index.php?g=base&m=repair&a=orderDetail&repairId='.$order['repair_id'].'&order_id='.$order['order_id'];
        if($this->wechatInfo['account_id'] == 2){//滨江后勤
            $template_id = 'HGT2HHBC-u-nP6Kur6gbWhqENf0851ktEqkeDOle6Z8';
        }elseif($this->wechatInfo['account_id'] == 25){// 正式服杭电
            $template_id = '2RpOYZn6vVTqJA1tkeABSDs5y2FzHjpuWl6j2OAAQjE';
        }elseif($this->wechatInfo['account_id'] == 17){// 正式浙商大
            $template_id = 'dlYpaScikkZa_hFw2MRLE6J-nPn4192x0GA6T_kkFS8';
        }elseif($this->wechatInfo['account_id'] == 60){// 测试服云感维修模板id
            $template_id = 'Rf7JatKFZNlX-Fji4e2AmRwCvffF8bCsUxdnsHCHAZs';
        }

        if($this->wechatInfo['account_id'] == 2){
            $info = array(
                'first' => array("value" => '取消订单提醒！','color' => '#173177'),
                'keyword1' => array("value" => date("Y-m-d H:i",$order['create_time'])),
                'keyword2' => array("value" => date("Y-m-d H:i",$order['cancel_time'])),
                'keyword3' => array("value" => '报修人取消'),
                'keyword4' => array("value" => $order['remark']),
                'remark' => array("value" => "请点击查看！","color" => "#173177"),
            );
        }elseif($this->wechatInfo['account_id'] == 17){
            $info = array(
                'first' => array("value" => '取消订单提醒！','color' => '#173177'),
                'keyword1' => array("value" => date("Y-m-d H:i",$order['create_time'])),
                'keyword2' => array("value" => date("Y-m-d H:i",$order['cancel_time'])),
                'keyword3' => array("value" => '报修人取消'),
                'keyword4' => array("value" => $order['remark']),
                'remark' => array("value" => "请点击查看！","color" => "#173177"),
            );
        }elseif($this->wechatInfo['account_id'] == 25 ){
            $info = array(
                'first' => array("value" => '取消订单提醒！','color' => '#173177'),
                'keyword1' => array("value" => date("Y-m-d H:i",$order['create_time'])),
                'keyword2' => array("value" => date("Y-m-d H:i",$order['cancel_time'])),
                'keyword3' => array("value" => '报修人取消'),
                'keyword4' => array("value" => $order['remark']),
                'remark' => array("value" => "请点击查看！","color" => "#173177"),
            );
        } else{
            $info = array(
                'first' => array("value" => '取消订单提醒！','color' => '#173177'),
                'keyword1' => array("value" => date("Y-m-d H:i",$order['create_time'])),
                'keyword2' => array("value" => date("Y-m-d H:i",$order['cancel_time'])),
                'keyword3' => array("value" => '报修人取消'),
                'keyword4' => array("value" => $order['remark']),
                'remark' => array("value" => "请点击查看！","color" => "#173177"),
            );
        }
        $result = $this->wxObj->messageTpl($this->wechatInfo['appid'], $this->wechatInfo['appsecret'], $wechatUserInfo['openid'], $template_id, $info, $url);
        return $result;
    }
	
	/**
	 * 方法参数可以自己修改，添加
	 * @param array $userData	用户信息
	 * @param array $orderInfo	订单信息
	 */
	public function orderConfirmSendMsg($order,$accountId)
	{
		$mOrder = D('RepairOrder');
		$mUser = D('User');
		$orderInfo = $mOrder->getByPk($order['order_id']);
		$repairman = $mUser->getByPk($orderInfo['repairman_id']);
		$wechatUserInfo = D('Wechat/WechatUser')->getInfo(array('user_id'=>$orderInfo['user_id']), 'openid,subscribe');
		$url = C('site_url').'/index.php?g=base&m=repair&a=orderDetail&repairId='.$orderInfo['repair_id'].'&order_id='.$orderInfo['order_id'];
		if($wechatUserInfo['subscribe']) {
			if($accountId == 4){
				$array = array(
						'first' => array("value" => $orderInfo['real_name'].'您的维修申请已经通过。','color' => '#173177'),
						'keyword1' => array("value" => '订单号'.$orderInfo['order_sn'] ),
						'keyword2' => array("value" => date("Y-m-d H:i:s")),
						'keyword3' => array("value" => '123456' ),
						'remark' => array("value" => "请点击查看！","color" => "#173177"),
				);
				
			}elseif($accountId == 11 || $accountId == 28){
				$array = array(
					'first' => array("value" => ($orderInfo['real_name']?$orderInfo['real_name']:$wechatUserInfo['nickname']).'您的维修申请已经通过。','color' => '#173177'),
					'keyword1' => array("value" => $orderInfo['order_sn'] ),
					'keyword2' => array("value" => '已接单' ),
					'keyword3' => array("value" => date("Y-m-d H:i:s")),
					'remark' => array("value" => "请点击查看！","color" => "#173177"),
				);
			}elseif ($accountId == 65) {
                $projectName = '';
                if ($orderInfo['project_id']) {
                    $projectInfo = D('Base/RepairProject')->getByProjectId($orderInfo['project_id']);
                    $projectName = $projectInfo['project_name'];
                }
                $childProject = '';
                if ($orderInfo['project_child_id']) {
                    $childInfo = D('Base/RepairProject')->getByProjectId($orderInfo['project_child_id']);
                    $childProject = ' ' . $childInfo['project_name'];
                }

                $projects = $projectName ? $projectName . ($childProject ? $childProject : '') : '-';
                $array = array(
                    'first' => array("value" => $orderInfo['real_name'] . '，您的维修申请已经通过。', 'color' => '#173177'),
                    'keyword1' => array("value" => $orderInfo['real_name']),
                    'keyword2' => array("value" => $orderInfo['content']),
                    'keyword3' => array("value" => $projects),
                    'keyword4' => array("value" => $orderInfo['community_name'] . $orderInfo['building_name'] . $orderInfo['room_name'] . $orderInfo['detail_address']),
                    'keyword5' => array("value" => date("Y-m-d H:i:s"), "color" => "#173177"),
                    'remark' => array("value" => "点击查看详情！", "color" => "#173177"),
                );
            }
			else{
				$array = array(
						'first' => array("value" => $orderInfo['real_name'].'，您的维修申请已经通过。','color' => '#173177'),
						'keyword2' => array("value" => $repairman['real_name'] ),
						'keyword1' => array("value" => date("Y-m-d H:i:s"),"color" => "#173177"),
						'remark' => array("value" => "请点击查看！","color" => "#173177"),
				);
				
			}
			
			
			if($accountId == 2){
				$template_id = 'ervBp_BlUtHqKsaIw0qjmFz2KXy9J1tWCF5TIhW042Q';
			}elseif($accountId==5){
				$template_id = 'p_P3GalanUy8syyholudeTR3OB5hzEuEAz-w12D_lbQ';
			}elseif($accountId==6){
				$template_id = 'DAxDdnfAhywT-lfRTsaSGOQwd96g5RQnXMTigQknWCA';
			}elseif($accountId == 4){
				$template_id = 'k203JXlZ8F8SCYUIR3uH_HBL8Uq2aAMbAIv2N1r46ec';
			}elseif($accountId == 10){
				$template_id = 'A4NBwXw1VQmYDOBzCImVstEnwLG2tvbkztK8vbJkc-I';
			}/*elseif($accountId == 28){
				$template_id = 'Rf7JatKFZNlX-Fji4e2AmRwCvffF8bCsUxdnsHCHAZs';
			}*/elseif($accountId==3){
				$template_id = 'yI0d_ILucYN4r_4lfnqsvwUOPd94K7Se7rQkUScaEiU';
			}elseif($accountId == 17){
				$template_id = 'qV44STOD0tpw_b2JHWrV7TsBk3uYdjpuCIYSp5gJqb4';
			}elseif($accountId == 11){
				$template_id = '0NSi0BNiF-5mrwd9MODtQ86jzp9G93DNnThFSTuXAiQ';
			}elseif($accountId == 28){
					$template_id = '-o2OC55fvrdUsNuXd0wFsM2hO3Rn8ey277dCpJTg3JI';
			}elseif($this->wechatInfo['account_id'] == 25){
				$template_id = 'z45szT_MnjF9lvP7u_nS-GueZqgIDdyya_ofwkjNg6g';
			}elseif ($accountId == 65) {
                $template_id = 'xuLPonzO3SE36UfXU3kJI4HAXQ0Q80cHWR1Unv5xCHg';
            }
			$this->wxObj->messageTpl($this->wechatInfo['appid'], $this->wechatInfo['appsecret'], $wechatUserInfo['openid'], $template_id, $array, $url);
		}
			
	}
	
	/**
	 * 订单完成处理
	 * @param array $userData
	 * @param array $orderInfo
	 */
	public function orderFinishSendMsg($orderInfo,$accountId)
	{
		$mUser = D('User');
		$repairman = $mUser->getFieldByUserId($orderInfo['repairman_id'],'real_name');
		$wechatUserInfo = D('Wechat/WechatUser')->getInfo(array('user_id'=>$orderInfo['user_id']), 'openid,subscribe');
		//$url = C('site_url')."/base/repair/orderDetail/repairId/".$orderInfo['repair_id']."/order_id/".$orderInfo['order_id'];
		$url = C('site_url').'/index.php?g=base&m=repair&a=orderDetail&repairId='.$orderInfo['repair_id'].'&order_id='.$orderInfo['order_id'];
		if($wechatUserInfo['subscribe']) {
			if($orderInfo['pay_type'] == 1 && $orderInfo['pay_time'] == 0) {
				if($accountId == 11){
					$array = array(
						'first' => array("value" => ($orderInfo['real_name']?$orderInfo['real_name']:$wechatUserInfo['nickname']).'您的维修已经完成,维修金额'.$orderInfo['order_amount'].'元，请尽快完成支付！','color' => '#173177'),
						'keyword1' => array("value" => $orderInfo['order_sn'] ),
						'keyword2' => array("value" => '已维修' ),
						'keyword3' => array("value" => date("Y-m-d H:i:s")),
						'remark' => array("value" => "请点击查看！","color" => "#173177"),
					);
				}elseif ($accountId == 65) {
                    $projectName = '';
                    if ($orderInfo['project_id']) {
                        $projectInfo = D('Base/RepairProject')->getByProjectId($orderInfo['project_id']);
                        $projectName = $projectInfo['project_name'];
                    }
                    $childProject = '';
                    if ($orderInfo['project_child_id']) {
                        $childInfo = D('Base/RepairProject')->getByProjectId($orderInfo['project_child_id']);
                        $childProject = ' ' . $childInfo['project_name'];
                    }

                    $projects = $projectName ? $projectName . ($childProject ? $childProject : '') : '-';
                    $array = array(
                        'first' => array("value" => $orderInfo['real_name'] . '，您的维修已经完成。', 'color' => '#173177'),
                        'keyword1' => array("value" => $orderInfo['real_name']),
                        'keyword2' => array("value" => $orderInfo['content']),
                        'keyword3' => array("value" => $projects),
                        'keyword4' => array("value" => $orderInfo['community_name'] . $orderInfo['building_name'] . $orderInfo['room_name'] . $orderInfo['detail_address']),
                        'keyword5' => array("value" => date("Y-m-d H:i:s"), "color" => "#173177"),
                        'remark' => array("value" => "点击查看详情！", "color" => "#173177"),
                    );
                }else{
					$array = array(
						'first' => array("value" => $orderInfo['real_name'].'，您的维修已经完成,维修金额'.$orderInfo['order_amount'].'元，请尽快完成支付！','color' => '#173177'),
						'keyword2' => array("value" => $repairman ),
						'keyword1' => array("value" => date("Y-m-d H:i:s"),"color" => "#173177"),
						'remark' => array("value" => "请点击查看！","color" => "#173177"),
					);
				}
			} elseif ($accountId == 65) {
                $projectName = '';
                if ($orderInfo['project_id']) {
                    $projectInfo = D('Base/RepairProject')->getByProjectId($orderInfo['project_id']);
                    $projectName = $projectInfo['project_name'];
                }
                $childProject = '';
                if ($orderInfo['project_child_id']) {
                    $childInfo = D('Base/RepairProject')->getByProjectId($orderInfo['project_child_id']);
                    $childProject = ' ' . $childInfo['project_name'];
                }

                $projects = $projectName ? $projectName . ($childProject ? $childProject : '') : '-';
                $array = array(
                    'first' => array("value" => $orderInfo['real_name'] . '，您的维修已经完成。', 'color' => '#173177'),
                    'keyword1' => array("value" => $orderInfo['real_name']),
                    'keyword2' => array("value" => $orderInfo['content']),
                    'keyword3' => array("value" => $projects),
                    'keyword4' => array("value" => $orderInfo['community_name'] . $orderInfo['building_name'] . $orderInfo['room_name'] . $orderInfo['detail_address']),
                    'keyword5' => array("value" => date("Y-m-d H:i:s"), "color" => "#173177"),
                    'remark' => array("value" => "点击查看详情！", "color" => "#173177"),
                );
            } else {
				if($accountId == 11 || $accountId == 28){
					$array = array(
						'first' => array("value" => $orderInfo['real_name'].'您的维修已经完成。','color' => '#173177'),
						'keyword1' => array("value" => $orderInfo['order_sn'] ),
						'keyword2' => array("value" => '已维修' ),
						'keyword3' => array("value" => date("Y-m-d H:i:s")),
						'remark' => array("value" => "请点击查看！","color" => "#173177"),
					);
				}else{
					$array = array(
						'first' => array("value" => $orderInfo['real_name'].'，您的维修已经完成。','color' => '#173177'),
						'keyword2' => array("value" => $repairman ),
						'keyword1' => array("value" => date("Y-m-d H:i:s"),"color" => "#173177"),
						'remark' => array("value" => "请点击查看！","color" => "#173177"),
					);
				}
			}

			if($accountId == 2){
				$template_id = 'ervBp_BlUtHqKsaIw0qjmFz2KXy9J1tWCF5TIhW042Q';
			}elseif($accountId==5){
				$template_id = 'p_P3GalanUy8syyholudeTR3OB5hzEuEAz-w12D_lbQ';
			}elseif($accountId==6){
				$template_id = 'DAxDdnfAhywT-lfRTsaSGOQwd96g5RQnXMTigQknWCA';
			}elseif($accountId == 4){
				$template_id = 'k203JXlZ8F8SCYUIR3uH_HBL8Uq2aAMbAIv2N1r46ec';
			}elseif($accountId == 10){
				$template_id = 'A4NBwXw1VQmYDOBzCImVstEnwLG2tvbkztK8vbJkc-I';
			}/*elseif($accountId == 28){
				$template_id = 'Rf7JatKFZNlX-Fji4e2AmRwCvffF8bCsUxdnsHCHAZs';
			}*/elseif($accountId==3){
				$template_id = 'yI0d_ILucYN4r_4lfnqsvwUOPd94K7Se7rQkUScaEiU';
			}elseif($accountId == 17){
				$template_id = 'qV44STOD0tpw_b2JHWrV7TsBk3uYdjpuCIYSp5gJqb4';
			}elseif($accountId == 11){
				$template_id = '0NSi0BNiF-5mrwd9MODtQ86jzp9G93DNnThFSTuXAiQ';
			}elseif($accountId == 28){
					$template_id = '-o2OC55fvrdUsNuXd0wFsM2hO3Rn8ey277dCpJTg3JI';
			}elseif($this->wechatInfo['account_id'] == 25){
				$template_id = 'z45szT_MnjF9lvP7u_nS-GueZqgIDdyya_ofwkjNg6g';
			}elseif ($accountId == 65) {
                $template_id = 'xuLPonzO3SE36UfXU3kJI4HAXQ0Q80cHWR1Unv5xCHg';
            }
			$this->wxObj->messageTpl($this->wechatInfo['appid'], $this->wechatInfo['appsecret'], $wechatUserInfo['openid'], $template_id, $array, $url);
		}
	}



	/**
	 * 维修工无法维修提交返修,发消息给用户
	 * @param array $userData	用户信息
	 * @param array $orderInfo	订单信息
	 */
	public function backSendMessage($order,$accountId)
	{
		$mOrder = D('RepairOrder');
		$mUser = D('User');
		$orderInfo = $mOrder->getByPk($order['order_id']);
		$repairman = $mUser->getByPk($orderInfo['repairman_id']);
		$wechatUserInfo = D('Wechat/WechatUser')->getInfo(array('user_id'=>$orderInfo['user_id']), 'openid,subscribe');
		$url = C('site_url').'/index.php?g=base&m=repair&a=orderDetail&repairId='.$orderInfo['repair_id'].'&order_id='.$orderInfo['order_id'];
		if($wechatUserInfo['subscribe']) {

			if($accountId==11 || $accountId == 28){
				$array = array(
						'first' => array("value" => ($orderInfo['real_name']?$orderInfo['real_name']:$wechatUserInfo['nickname']).'您的维修单已提交返修,请确认并重新下单。','color' => '#FF0000'),
						'keyword1' => array("value" => $orderInfo['order_sn'] ),
						'keyword2' => array("value" => '已返修' ),
						'keyword3' => array("value" => date("Y-m-d H:i:s")),
						'remark' => array("value" => "请点击查看！","color" => "#173177"),
					);
			}else{


				$array = array(
						'first' => array("value" => $orderInfo['real_name'].'，您的维修单已提交返修,请确认并重新下单。','color' => '#FF0000'),
						'keyword2' => array("value" => $repairman['real_name'] ),
						'keyword1' => array("value" => date("Y-m-d H:i:s"),"color" => "#173177"),
						'remark' => array("value" => "请点击查看！","color" => "#173177"),
				);
			}
			
			
			if($accountId == 2){
				$template_id = 'ervBp_BlUtHqKsaIw0qjmFz2KXy9J1tWCF5TIhW042Q';
			}elseif($accountId==5){
				$template_id = 'p_P3GalanUy8syyholudeTR3OB5hzEuEAz-w12D_lbQ';
			}elseif($accountId==6){
				$template_id = 'DAxDdnfAhywT-lfRTsaSGOQwd96g5RQnXMTigQknWCA';
			}elseif($accountId == 4){
				$template_id = 'k203JXlZ8F8SCYUIR3uH_HBL8Uq2aAMbAIv2N1r46ec';
			}elseif($accountId == 10){
				$template_id = 'A4NBwXw1VQmYDOBzCImVstEnwLG2tvbkztK8vbJkc-I';
			}elseif($accountId == 28){
				$template_id = 'Rf7JatKFZNlX-Fji4e2AmRwCvffF8bCsUxdnsHCHAZs';
			}elseif($accountId==3){
				$template_id = 'yI0d_ILucYN4r_4lfnqsvwUOPd94K7Se7rQkUScaEiU';
			}elseif($accountId == 17){
				$template_id = 'qV44STOD0tpw_b2JHWrV7TsBk3uYdjpuCIYSp5gJqb4';
			}elseif($accountId == 11){
				$template_id = '0NSi0BNiF-5mrwd9MODtQ86jzp9G93DNnThFSTuXAiQ';
			}elseif($accountId == 28){
				$template_id = '-o2OC55fvrdUsNuXd0wFsM2hO3Rn8ey277dCpJTg3JI';
			}elseif($this->wechatInfo['account_id'] == 25){
				$template_id = 'z45szT_MnjF9lvP7u_nS-GueZqgIDdyya_ofwkjNg6g';
			}
			$this->wxObj->messageTpl($this->wechatInfo['appid'], $this->wechatInfo['appsecret'], $wechatUserInfo['openid'], $template_id, $array, $url);
		}
			
	}
	
// 	/**
// 	 * 创建订单完成后发送短信
// 	 * @param array $userData	用户信息
// 	 * @param array $orderInfo	订单信息
// 	 */
// 	public function createOrderSendMsg($userData, $orderInfo)
// 	{
// 		//todo...
// 	}
	
// 	/**
// 	 * 订单评论发送消息
// 	 * @param array $userData	用户信息
// 	 * @param array $orderInfo 订单信息
// 	 */
// 	public function orderCommentSendMsg($userData, $orderInfo)
// 	{
// 		//todo...
// 	}
}
